#============================================================
#	Main
#============================================================
# @datetime: 2022-3-8 11:05:35
#============================================================
extends Node2D


#============================================================
#   内置
#============================================================
func _ready():
	Global.player.global_position = MapData.start_pos
	
	yield(get_tree().create_timer(0.2), "timeout")
	var camera_2d = get_node("Enviroment/Level/Other/Camera2D")
	camera_2d.force_update_transform()
	camera_2d.force_update_scroll()
	
	var skill = SkillInterface.get_skill(Global.player, "Attack")
	print(skill)


func _unhandled_input(event):
	if event is InputEventMouseButton:
		if event.pressed and event.button_index == BUTTON_LEFT:
			var level := MapData.map
			var pos = level.world_to_map(level.to_local(event.global_position))
			Logger.info(self, [
				pos, level.get_cellv(pos)
			], "\t")


